<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>家族谱 - 家族网站与家谱制作平台</title>
    <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap');
        body {
            font-family: 'Noto Sans SC', sans-serif;
        }
        .sidebar-item.active {
            background-color: rgba(255, 255, 255, 0.1);
            border-left: 4px solid #fff;
        }
        @media (max-width: 768px) {
            .sidebar {
                display: none;
            }
            .sidebar.show {
                display: block;
                position: fixed;
                top: 0;
                left: 0;
                width: 250px;
                height: 100vh;
                z-index: 50;
            }
        }
    </style>
</head>
<body class="bg-gray-100">
    <!-- 移动端顶部导航 -->
    <div class="md:hidden bg-white shadow-md py-3 px-4 flex justify-between items-center sticky top-0 z-10">
        <button id="menu-toggle" class="text-gray-700">
            <i class="fas fa-bars text-xl"></i>
        </button>
        <div class="text-center">
            <h1 class="text-xl font-bold text-gray-800">家族谱</h1>
        </div>
        <div>
            <img src="https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&auto=format&fit=crop&w=100&q=80" 
                 class="w-8 h-8 rounded-full" alt="用户头像">
        </div>
    </div>

    <div class="flex min-h-screen">
        <!-- 侧边栏 -->
        <div id="sidebar" class="sidebar bg-gray-800 text-white w-64 py-4 flex-shrink-0 hidden md:block">
            <div class="px-6 py-4">
                <h1 class="text-2xl font-bold">家族谱</h1>
                <p class="text-gray-400 text-sm">家族网站与家谱制作平台</p>
            </div>
            <div class="mt-6">
                <nav>
                    <a href="home.html" class="sidebar-item flex items-center px-6 py-3 text-gray-300 hover:bg-gray-700 hover:text-white">
                        <i class="fas fa-home mr-3"></i>
                        <span>首页</span>
                    </a>
                    <a href="profile.html" class="sidebar-item flex items-center px-6 py-3 text-gray-300 hover:bg-gray-700 hover:text-white">
                        <i class="fas fa-user mr-3"></i>
                        <span>个人资料</span>
                    </a>
                    <a href="family-tree.html" class="sidebar-item flex items-center px-6 py-3 text-gray-300 hover:bg-gray-700 hover:text-white">
                        <i class="fas fa-sitemap mr-3"></i>
                        <span>家谱编辑</span>
                    </a>
                    <a href="genealogy.html" class="sidebar-item flex items-center px-6 py-3 text-gray-300 hover:bg-gray-700 hover:text-white">
                        <i class="fas fa-project-diagram mr-3"></i>
                        <span>世系图生成</span>
                    </a>
                    <a href="social.html" class="sidebar-item flex items-center px-6 py-3 text-gray-300 hover:bg-gray-700 hover:text-white">
                        <i class="fas fa-comments mr-3"></i>
                        <span>家族社交圈</span>
                    </a>
                    <a href="events.html" class="sidebar-item flex items-center px-6 py-3 text-gray-300 hover:bg-gray-700 hover:text-white">
                        <i class="fas fa-calendar-alt mr-3"></i>
                        <span>家族活动</span>
                    </a>
                    <a href="stories.html" class="sidebar-item flex items-center px-6 py-3 text-gray-300 hover:bg-gray-700 hover:text-white">
                        <i class="fas fa-book-open mr-3"></i>
                        <span>家族故事与历史</span>
                    </a>
                    <a href="settings.html" class="sidebar-item flex items-center px-6 py-3 text-gray-300 hover:bg-gray-700 hover:text-white">
                        <i class="fas fa-cog mr-3"></i>
                        <span>设置</span>
                    </a>
                </nav>
            </div>
            <div class="mt-auto px-6 py-4">
                <div class="flex items-center">
                    <img src="https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&auto=format&fit=crop&w=100&q=80" 
                         class="w-10 h-10 rounded-full mr-3" alt="用户头像">
                    <div>
                        <p class="text-sm font-medium">张三</p>
                        <p class="text-xs text-gray-400">查看个人资料</p>
                    </div>
                </div>
            </div>
        </div>

        <!-- 主内容区 -->
        <div class="flex-1 overflow-auto">
            <div class="container mx-auto py-6 px-4">
                <!-- 页面内容将在这里插入 -->
                <div id="content">
                    <!-- 各页面内容 -->
                </div>
            </div>
        </div>
    </div>

    <script>
        // 移动端菜单切换
        document.getElementById('menu-toggle').addEventListener('click', function() {
            document.getElementById('sidebar').classList.toggle('show');
        });

        // 点击页面其他区域关闭菜单
        document.addEventListener('click', function(event) {
            const sidebar = document.getElementById('sidebar');
            const menuToggle = document.getElementById('menu-toggle');
            
            if (sidebar.classList.contains('show') && 
                !sidebar.contains(event.target) && 
                event.target !== menuToggle) {
                sidebar.classList.remove('show');
            }
        });

        // 设置当前活跃页面
        document.addEventListener('DOMContentLoaded', function() {
            const currentPage = window.location.pathname.split('/').pop();
            const sidebarItems = document.querySelectorAll('.sidebar-item');
            
            sidebarItems.forEach(item => {
                const href = item.getAttribute('href');
                if (href === currentPage) {
                    item.classList.add('active');
                }
            });
        });
    </script>
</body>
</html> 